﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin.master" AutoEventWireup="true" CodeFile="LoaiTu.aspx.cs" Inherits="Views_Admin_LoaiTu" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    <style type="text/css">
        .style1
        {
            width: 100%;
        }
        .style2
        {
            font-family: Georgia;
        }
        .style3
        {}
        .style4
        {
            width: 335px;
        }
        .style5
        {
            width: 141px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <form id="form1" runat="server">
    <table class="style1">
        <tr>
            <td align="center" class="style2">
                Danh sách loại từ</td>
        </tr>
        <tr>
            <td align="center" class="style2">
                Tìm kiếm :</td>
        </tr>
        <tr>
            <td align="center">
                &nbsp;</td>
        </tr>
        <tr>
            <td align="center">
                <br />
    <asp:MultiView ID="MultiView1" runat="server" ActiveViewIndex="0" onactiveviewchanged="MultiView1_ActiveViewChanged" 
        >
        <asp:View ID="View1" runat="server">
            <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
                onrowcommand="GridView1_RowCommand" 
                onselectedindexchanging="GridView1_SelectedIndexChanging" 
                DataKeyNames="MaTu" onrowediting="GridView1_RowEditing">
                <Columns>
                    <asp:TemplateField>
                        <HeaderTemplate>
                            <input ID="CheckHet" runat="server" onclick="setAll( this )" type="checkbox" />
                        </HeaderTemplate>
                        <ItemTemplate>
                            <asp:CheckBox ID="CheckBox" runat="server" />
                        </ItemTemplate>
                        <ControlStyle ForeColor="White" />
                        <HeaderStyle BackColor="#6666FF" BorderColor="#333333" BorderStyle="Solid" 
                            BorderWidth="1px" ForeColor="White" />
                        <ItemStyle BackColor="White" BorderColor="#333333" BorderStyle="Solid" 
                            BorderWidth="1px" />
                    </asp:TemplateField>
                    <asp:BoundField DataField="MaTu" HeaderText="Mã " ReadOnly="True">
                    <FooterStyle BorderColor="#333333" BorderStyle="Solid" BorderWidth="1px" />
                    <HeaderStyle BackColor="#6666FF" BorderColor="#333333" BorderStyle="Solid" 
                        BorderWidth="1px" ForeColor="White" />
                    <ItemStyle BackColor="White" BorderColor="#333333" BorderStyle="Solid" 
                        BorderWidth="1px" />
                    </asp:BoundField>
                    <asp:TemplateField HeaderText="Loại Từ">
                        <EditItemTemplate>
                            <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("TenLoaiTu") %>'></asp:TextBox>
                        </EditItemTemplate>
                        <ItemTemplate>
                            <asp:Label ID="Label2" runat="server" Text='<%# Bind("TenLoaiTu") %>'></asp:Label>
                        </ItemTemplate>
                        <FooterStyle BorderColor="#333333" BorderStyle="Solid" BorderWidth="1px" />
                        <HeaderStyle BackColor="#6666FF" BorderColor="#333333" BorderStyle="Solid" 
                            BorderWidth="1px" ForeColor="White" />
                        <ItemStyle BackColor="White" BorderColor="#333333" BorderStyle="Solid" 
                            BorderWidth="1px" />
                    </asp:TemplateField>
                    <asp:CommandField DeleteText="Xóa" ShowDeleteButton="True">
                    <HeaderStyle BackColor="#6666FF" BorderColor="#333333" BorderStyle="Solid" 
                        BorderWidth="1px" />
                    <ItemStyle BackColor="White" BorderColor="#333333" BorderStyle="Solid" 
                        BorderWidth="1px" />
                    </asp:CommandField>
                    <asp:CommandField EditText="Sửa" ShowEditButton="True">
                    <HeaderStyle BackColor="#6666FF" BorderColor="#333333" BorderStyle="Solid" 
                        BorderWidth="1px" />
                    <ItemStyle BackColor="White" BorderColor="#333333" BorderStyle="Solid" 
                        BorderWidth="1px" />
                    </asp:CommandField>
                </Columns>
            </asp:GridView>
            <br />
            <asp:Button ID="Button3" runat="server" Text="Xoa het" />
            <asp:LinkButton ID="btnthemmoi" runat="server" onclick="btnthemmoi_Click">Thêm mới</asp:LinkButton>
        </asp:View>
        <asp:View ID="View2" runat="server">
            <table class="style1">
                <tr>
                    <td>
                        <asp:FormView ID="FormView1" runat="server" 
                            onitemcommand="FormView1_ItemCommand" 
                            >
                            <ItemTemplate>
                                <table class="style1">
                                    <tr>
                                        <td>
                                            <asp:Label ID="Label1" runat="server" Text="Tên loại từ"></asp:Label>
                                        </td>
                                        <td>
                                            <asp:TextBox ID="txttenloai" runat="server" Text='<%# Eval("TenLoaiTu") %>'></asp:TextBox>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <asp:Button ID="Button2" runat="server" CommandName="update" Height="23px" 
                                                Text="Sửa" />
                                        </td>
                                        <td>
                                            <asp:Button ID="btncancel" runat="server" CommandName="Cancel" Text="Hủy" />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <asp:LinkButton ID="btntrove" runat="server" onclick="btntrove_Click">Trở về</asp:LinkButton>
                                        </td>
                                        <td>
                                            &nbsp;</td>
                                    </tr>
                                </table>
                            </ItemTemplate>
                        </asp:FormView>
                    </td>
                </tr>
            </table>
        </asp:View>
        <asp:View ID="View3" runat="server">
            <table class="style1">
                <tr>
                    <td colspan="2">
                        Bảng thêm mới</td>
                </tr>
                <tr>
                    <td align="right" class="style4">
                        Loại từ :</td>
                    <td align="left">
                        <asp:TextBox ID="txtten" runat="server"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td align="right" class="style3">
                        <asp:Button ID="btnthem" runat="server" onclick="btnthem_Click" Text="Thêm" />
                    </td>
                    <td align="left" class="style3">
                        <asp:Button ID="btnhuy" runat="server" onclick="btnthem_Click" Text="Hủy" />
                    </td>
                </tr>
                <tr>
                    <td align="right" class="style4">
                        <asp:LinkButton ID="btnback" runat="server" onclick="btnback_Click">Trở về</asp:LinkButton>
                    </td>
                    <td align="left">
                        &nbsp;</td>
                </tr>
            </table>
        </asp:View>
    </asp:MultiView>
            </td>
        </tr>
    </table>
    </form>
</asp:Content>

